//
//  FDWebSocketTool.h
//  FD
//
//  Created by xiaofang wang on 2019/1/4.
//  Copyright © 2019年 ZhiYuan Network. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface FDPushWebSocketTool : NSObject

/**1-19标记是否建立了socket连接 用于实现此功能  9.2、用户登录-》退出APP-》再次打开APP，自动登录后，没有与消息推送websocket建立连接
 自动登录时候判断如果为NO 建立连接。
 默认NO 没有建立连接
 代理回调中进行状态赋值
 */
@property (nonatomic, assign) BOOL isFDPushWebSocketConnect;

/**单例类:推送socket单例类*/
+ (instancetype)defaultFdWebPushSockcet;

/**0.初始化推送webSocket*/
- (void)setupAndOpenPushWebSocket;
/**1.断开连接*/
- (void)closePushWebSocket;
/**2.重新连接*/
//- (void)reconnectPushSocket;

//代理回调：建立连接。连接失败。发送消息。

//2.

//3.
@end

NS_ASSUME_NONNULL_END

#pragma mark - 参考数据
//服务器返回的
/**
{"event":"PUSH","data":{"id":"88e14043-780d-4896-ab39-b0cf1e6e61c7","type":"RICH_TEXT","body":{"title":"helloworld1","thumbnail":"helloworld1","resource":"helloworld1"},"createTime":1541070005122},"describe":""}
 */

/**
 "{"event":"PUSH","data":{"id":"45c313ac-ed21-4c03-9336-f728d023e20f","type":"RICH_TEXT","body":{"title":"helloworld[11]","thumbnail":"public/859667e07c984efba2ef521b15b8155c","resource":"public/ca4bd7ba43254a87bd51e9f3436c9737"},"createTime":1546653611146},"describe":""}"
 */

//请求消息格式。
/**
 {"event":"PUSH_READ","data":{"id":"be2e3c2e-e0d9-4522-bc17-55f5ae0bdf28"}}
 */
